import axios from "axios"

// 关注 
// 查看我的关注列表
async function MyFollowList(){
  var result
  await axios({
      baseURL: 'api/follow/myfollowlist',
      method: 'get',
  }).then(res => {
      result=res.data
      console.log(result);
  })
  return result
}

//   关注、取消关注
async function Follow(id,isFollow){
  var result
  await axios({
      baseURL: 'api/follow/'+id+'/'+isFollow,
      method: 'put',
  }).then(res => {
      result=res.data
      console.log(result);
  })
  return result
}
// 是否关注该用户了
async function IsFollow(id){
  var result
  await axios({
      baseURL: 'api/follow/or/not/'+id,
      method: 'get',
  }).then(res => {
      result=res.data
      console.log(result);
  })
  return result
}

//    共同关注
async function FollowCommons(id){
  var result
  await axios({
      baseURL: 'api/follow/common/'+id,
      method: 'get',
  }).then(res => {
      result=res.data
      console.log(result);
  })
  return result
}



export default {
  name: 'FollowAPI',
  MyFollowList,
  Follow,
  IsFollow,
  FollowCommons
}
